import React from 'react';
import CommonPage from '@/components/page/CommonPage';
import { renderNumber } from '@/utils/common';
const daoName = 'Shidnicliexs';
const importName = 'Shidnicliedr';
const importDaoName = 'Shidnicliedr';

const columns: API.Column[] = [
  {
    title: '证件号码',
    width: 120,
    sorter: true,
    dataIndex: 'IDNO',
    key: 'IDNO',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '客户名称',
    width: 120,
    sorter: true,
    dataIndex: 'CUNM',
    key: 'CUNM',
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '员工号',
    width: 120,
    sorter: true,
    dataIndex: 'EMNO',
    key: 'EMNO',
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '员工名称',
    width: 120,
    sorter: true,
    dataIndex: 'EMNM',
    key: 'EMNM',
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '所属部门',
    width: 120,
    sorter: true,
    dataIndex: 'DPNM',
    key: 'DPNM',
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '员工占比',
    width: 120,
    sorter: true,
    dataIndex: 'DSVL',
    key: 'DSVL',
    render: (data) => renderNumber('.2f%', data),
    dispaly: true,
    filter: false,
    export: true,
  },
];
const controls: API.Control[] = [
  {
    name: 'IDNO',
    rules: [{ required: true, message: '不能为空' }],
    type: 'text',
    label: '证件号码',
    grid: 12 / 24,
  },
];

const ShIndiPhjrForm: React.FC = () => {
  return (
    <CommonPage
      daoName={daoName}
      columns={columns}
      controls={controls}
      title="客户关联关系导入"
      importName={importName}
      importDaoName={importDaoName}
      importControls={controls}
      importMode="TruncteAfterInsert"
      importTemplateName="客户关系导入模板"
      initSorter={{ FieldName: 'IDNO', Direction: 'ASC' }}
    />
  );
};

export default ShIndiPhjrForm;
